package com.study.mq.kafka;

import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.config.TopicBuilder;

/**
 * @author ysy
 * @version 1.0
 * @Title: kafkaConfig
 * @Note <b>ProjectName:</b> Pre-research
 * <br><b>PackageName:</b> com.study.mq.kafka
 * <br><b>ClassName:</b>
 * <br><b>Date:</b>
 */
@Configuration
public class kafkaConfig {

    /**
     * @Author ysy
     * @Description 新建topic：指定名称、分区数量、副本数量
     * @Date 17:25 []
     * @Param 
     * @return org.apache.kafka.clients.admin.NewTopic
     **/
    @Bean
    public NewTopic topicCreat(){
        return TopicBuilder.name("my_topic_1").partitions(3).replicas(2).build();
    }
}
